
CURRENT_USER=$1
if  [ ! -n "${CURRENT_USER}" ] ;then
    echo "Add sudo failed, you need input username parameter!"
    exit 1
fi

grep "${CURRENT_USER} ALL=(ALL:ALL) ALL" /etc/sudoers | grep -v "#" > /dev/null
if [ $? -ne 0 ] ;then    
   echo "${CURRENT_USER} ALL=(ALL:ALL) ALL" > /etc/sudoers.d/${CURRENT_USER}_specific_for_ADKInstaller
 
   chmod 0440 /etc/sudoers
   echo "add sudo right for ${CURRENT_USER}"
   exit 0
fi


echo "no need add sudo right for ${1}"
